//
//  ColorButton.swift
//  NoteBook
//
//  Created by iOS Developer on 2017/4/27.
//  Copyright © 2017年 sunsheen. All rights reserved.
//

import UIKit

class ColorButton: UIButton {
    
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
        super.touchesBegan(touches, with: event)
    }
    override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
        transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
        super.touchesEnded(touches, with: event)
    }
    
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
        layer.cornerRadius = 15
        layer.masksToBounds = true
    }    
}
